package com.zxy.demo.java.reflect;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * MyInvocationHandler.
 * 
 * Created by zxybird on 2017/12/7.
 */
public class MyInvocationHandler<T> implements InvocationHandler {

  private T object;

  public InvocationHandler setObject(T object) {
    this.object = object;
    return this;
  }

  @Override
  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    return method.invoke(object, args);
  }
}
